<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title></title>
		<link rel="stylesheet" href="../../css/font.css" />
		<link rel="stylesheet" href="../../css/common.css" />
		<link rel="stylesheet" href="../../css/loans.css" />
		<script type="text/javascript">
			document.addEventListener('plusready', function() {
				//console.log("所有plus api都应该在此事件发生后调用，否则会出现plus is undefined。"

			});
		</script>

	</head>
	<body>
		<header class=" header-module ">
			<div class="flex-justify-align header-top">
				<a href="../../setting.html" class="iconfont iconfanhuijiantou header-back"></a>
				<p class="header-title">我的需求</p>
				<span class="header-span"></span>
			</div>
		
		</header>
		<article class="middle-moudle">
			<section class="loans-data" id="loans-data">
			
			</section>
		</article>
		<footer class="footer-module">
			<nav class="flex-justify-align footer-nav ">
				<a href="../../home.html" >
					<span class="iconfont iconshouye"></span><p>首页</p>
				</a>
				<a href="../../apply.html" >
					<span class="iconfont icontibao"></span><p>提报</p>
				</a>
				<a href="../../setting.html">
					<span class="iconfont iconwode"></span><p>我的</p>
				</a>
			</nav>
		</footer>
	</body>
	
	<script src="../../js/jquery-3.0.0.min.js"></script> 
	<script src="../../js/gloab.js"></script>
	<script>   
		$(function () {
			loadData();
		});
		
		function loadData(){
			console.log(localStorage.getItem("company"));
			var company = JSON.parse(localStorage.getItem("company"));
			$.ajax({    
				//请求方式    
				type:"GET",    
				//文件位置    
				url:basePath+"app/tdeclare/list",  
				data: {"companyId":company.id,"limit":100,"page":1},
				//返回数据格式为json,也可以是其他格式如    
				dataType: "json",    
				//请求成功拼接html    
				success: function(data){   
					var order = data.page.list;
					console.log(order);
					var str="";
					$.each(order,function(i,n){    
						str+='<a class="flex-justify-align base-interval loans-item">';
						//str+='	<img src="../../img/loans/loans-data-type.png" />';
						str+='	<div class="loans-info">';
						if(order[i].declareTypeId == 1){
							str+='<p class="header-title">贷款提报</p>';
							str+='		<span>申请用途：'+order[i].used+'</span>';
							str+='		<span>申请金额：'+order[i].money+'</span>';
							str+='		<span>抵押方式：'+order[i].modes+'</span>';
							str+='		<span>提报说明：'+order[i].remark+'</span>';
						}else if(order[i].declareTypeId == 2){
							str+='<p class="header-title">担保提报</p>';
							str+='		<span>申请用途：'+order[i].used+'</span>';
							str+='		<span>申请金额：'+order[i].money+'</span>';
							str+='		<span>抵押方式：'+order[i].modes+'</span>';
							str+='		<span>提报说明：'+order[i].remark+'</span>';
						}else if(order[i].declareTypeId == 3){
							str+='<p class="header-title">保险提报</p>';
							str+='		<span>需求金额：'+order[i].money+'</span>';
							str+='		<span>需求描述：'+order[i].remark+'</span>';
						}else if(order[i].declareTypeId == 4){
							str+='<p class="header-title">基金提报</p>';
							str+='		<span>主营业务范围：'+order[i].used+'</span>';
							str+='		<span>需求金额：'+order[i].money+'</span>';
							str+='		<span>年营业收入：'+order[i].remark+'</span>';
						}else if(order[i].declareTypeId == 5){
							str+='<p class="header-title">奖励提报</p>';
							str+='		<span>申请描述：'+order[i].used+'</span>';
							str+='		<span>申请金额：'+order[i].money+'</span>';
							str+='		<span>申请类型：'+order[i].modes+'</span>';
						}
						str+='	</div>';
						str+='</a>';
					});   
					$("#loans-data").append(str); 
				}    
			}); 		
		}	
	</script>
</html>
